<?php
/* @var $this SiteController */
/* @var $model ContactForm */
/* @var $form CActiveForm */

$this->pageTitle=Yii::app()->name . ' - Contact Us';
$this->breadcrumbs=array(
    Yii::t('app','main.contact'),
);
?>

<h1><?php echo Yii::t('app','contact.contact') ?></h1>

<?php if(Yii::app()->user->hasFlash('contact')): ?>

<div class="flash-success">
        <?php echo Yii::app()->user->getFlash('contact'); ?>
</div>

<?php else: ?>
<p class="culture-pl">
        <?php echo Yii::t('app','contact.content') ?>
</p>

<div class="form">

        <?php $form=$this->beginWidget('CActiveForm', array(
            'id'=>'contact-form',
            'enableClientValidation'=>true,
            'clientOptions'=>array(
            'validateOnSubmit'=>true,
            ),
        )); ?>

    <p class="note"><?php echo Yii::t('app','general.required');?></p>

        <?php echo $form->errorSummary($model); ?>

    <div class="row">
            <?php echo $form->labelEx($model,'name'); ?>
        <div class="input-group">
                <?php echo $form->textField($model,'name',array('class'=>'form-control')); ?>
        </div>
            <?php echo $form->error($model,'name'); ?>
    </div>
    
    <div class="row">
            <?php echo $form->labelEx($model,'email'); ?>
        <div class="input-group">
                <?php echo $form->textField($model,'email',array('class'=>'form-control')); ?>
        </div>
            <?php echo $form->error($model,'email'); ?>
    </div>

    <div class="row">
            <?php echo $form->labelEx($model,'subject'); ?>
        <div class="input-group">
                <?php echo $form->textField($model,'subject',array('size'=>60,'maxlength'=>128,'class'=>'form-control')); ?>
        </div>
            <?php echo $form->error($model,'subject'); ?>
    </div>

    <div class="row">
            <?php echo $form->labelEx($model,'body'); ?>
        <div class="input-group">
                <?php echo $form->textArea($model,'body',array('rows'=>6, 'cols'=>50,'class'=>'form-control')); ?>
        </div>
            <?php echo $form->error($model,'body'); ?>
    </div>

        <?php if(CCaptcha::checkRequirements()): ?>
    <div class="row">
                <?php echo $form->labelEx($model,'verifyCode'); ?>
        <div class="input-group">
                    <?php $this->widget('CCaptcha'); ?>
                    <?php echo $form->textField($model,'verifyCode'); ?>
        </div>
        <div class="hint"><?php echo Yii::t('app','general.recaptcha');?>
        </div>
                <?php echo $form->error($model,'verifyCode'); ?>
    </div>
        <?php endif; ?>

    <div class="row buttons">
            <?php echo CHtml::htmlButton(Yii::t('app','contact.submit'), array('class' => 'btn btn-lg btn-primary', 'type' => 'submit')); ?>
    </div>
        <?php $this->endWidget(); ?>
</div><!-- form -->
<?php endif; ?>